import Vue from 'vue';
import VueRouter from 'vue-router';

import Layout from '@/views/Layout.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-house',
    redirect: '/index',
    hidden: true,
    name: '首页',
    children: [
      {
        path: '/index',
        name: '首页',
        component: () => import('@/views/index/Index.vue'),
        hidden: true
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-watermelon',
    name: '学生管理',
    children: [
      {
        path: '/student/student-list',
        name: '学生列表',
        component: () => import('@/views/student/StudentList.vue'),
      },
      {
        path: '/student/add-student',
        name: '增加学生',
        component: () => import('@/views/student/AddAndModifyStudent.vue'),
      },
      {
        path: '/student/modify-student',
        name: '修改学生',
        component: () => import('@/views/student/AddAndModifyStudent.vue'),
        hidden: true
      },
      {
        path: '/student/detail/:sid',
        name: '查看学生详情',
        component: () => import('@/views/student/StudentDetail.vue'),
        // 在左边的导航菜单中，隐藏
        hidden: true
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-watermelon',
    name: '二手车管理',
    children: [
      {
        path: '/car/car-list',
        name: '汽车列表',
        component: () => import('@/views/car/CarList.vue'),
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-goods',
    name: '商品管理',
    children: [
      {
        path: '/goods/goods-list',
        name: '商品列表',
        component: () => import('@/views/goods/GoodsList.vue'),
      },
      {
        path: '/goods/add-good',
        name: '增加商品',
        component: () => import('@/views/goods/AddGood.vue'),
      },
      {
        path: '/goods/good-type',
        name: '商品类型管理',
        component: () => import('@/views/goods/GoodType.vue'),
      },
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-tickets',
    name: '订单管理',
    children: [
      {
        path: '/order/order-list',
        name: '订单列表',
        component: () => import('@/views/order/OrderList.vue'),
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-user',
    name: '会员管理',
    children: [
      {
        path: '/vip/vip-list',
        name: '会员列表',
        component: () => import('@/views/vip/VipList.vue'),
      },
      {
        path: '/vip/add-vip',
        name: '添加会员',
        component: () => import('@/views/vip/AddVip.vue'),
      },
      {
        path: '/vip/shipping-address',
        name: '收货地址管理',
        component: () => import('@/views/vip/ShippingAddress.vue'),
        hidden: true
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    iconCls: 'el-icon-watermelon',
    name: '网点管理',
    children: [
      {
        path: '/wdgl',
        name: '网点管理',
        component: () => import('@/views/wdgl/Wdgl.vue'),
      },
      {
        path: '/xuelang',
        name: '仿学浪搜索逻辑',
        component: () => import('@/views/wdgl/Xuelang.vue'),
      }
    ]
  },
  {
    path: '/login',
    name: '登录',
    hidden: true,
    component: () => import('@/views/login/Login.vue'),
  }
];

const router = new VueRouter({
  routes
});

export default router;
